using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;
namespace eTMS.DAO{
	/********************************BEGIN KieuHuongTroCapDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:26/10/2011 34:05:09</para>
	/// <para>Class Name: KieuHuongTroCapDAO</para>
	/// <para>Description: Class access to table KieuHuongTroCap in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class KieuHuongTroCapDAO : DAOBase<KieuHuongTroCapEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: KieuHuongTroCap_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int KieuHuongTroCap_ID){
			string strSQL="SELECT  [KieuHuongTroCap_ID],[LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap] FROM [KieuHuongTroCap]  WHERE [KieuHuongTroCap].[KieuHuongTroCap_ID]=@KieuHuongTroCap_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",KieuHuongTroCap_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: KieuHuongTroCap_ID</para>
		/// <para>Output: KieuHuongTroCapEntity</para>
		///</summary>
		public KieuHuongTroCapEntity SelectOne(int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(KieuHuongTroCap_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [KieuHuongTroCap_ID],[LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap] FROM [KieuHuongTroCap] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [KieuHuongTroCap_ID],[LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap] FROM [KieuHuongTroCap]  WHERE [KieuHuongTroCap].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of KieuHuongTroCapEntity</para>
		///</summary>
		public List<KieuHuongTroCapEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [KieuHuongTroCap_ID],[LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap] FROM [KieuHuongTroCap]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [KieuHuongTroCap_ID],[LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap] FROM [KieuHuongTroCap]  WHERE [KieuHuongTroCap].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of KieuHuongTroCapEntity</para>
		///</summary>
		public List<KieuHuongTroCapEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(KieuHuongTroCapEntity o){
			string strSQL="INSERT INTO [KieuHuongTroCap]([LoaiDoiTuongTroCap_ID],[KhoanTien_ID],[MucTroCap],[KieuTroCap]) VALUES  (@LoaiDoiTuongTroCap_ID,@KhoanTien_ID,@MucTroCap,@KieuTroCap);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLoaiDoiTuongTroCap_ID)
				this.CreateCommandParameter(cmd,"@LoaiDoiTuongTroCap_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LoaiDoiTuongTroCap_ID",o.LoaiDoiTuongTroCap_ID);

			if(o.IsNullKhoanTien_ID)
				this.CreateCommandParameter(cmd,"@KhoanTien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhoanTien_ID",o.KhoanTien_ID);

			if(o.IsNullMucTroCap)
				this.CreateCommandParameter(cmd,"@MucTroCap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MucTroCap",o.MucTroCap);

			if(o.IsNullKieuTroCap)
				this.CreateCommandParameter(cmd,"@KieuTroCap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KieuTroCap",o.KieuTroCap);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Save</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(KieuHuongTroCapEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.KieuHuongTroCap_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of KieuHuongTroCapEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<KieuHuongTroCapEntity>list){
			foreach(KieuHuongTroCapEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(KieuHuongTroCapEntity o){
			string strSQL="UPDATE  [KieuHuongTroCap] SET [KieuHuongTroCap].[LoaiDoiTuongTroCap_ID]=@LoaiDoiTuongTroCap_ID,[KieuHuongTroCap].[KhoanTien_ID]=@KhoanTien_ID,[KieuHuongTroCap].[MucTroCap]=@MucTroCap,[KieuHuongTroCap].[KieuTroCap]=@KieuTroCap WHERE [KieuHuongTroCap].[KieuHuongTroCap_ID]=@KieuHuongTroCap_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullKieuHuongTroCap_ID)
				this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",o.KieuHuongTroCap_ID);

			if(o.IsNullLoaiDoiTuongTroCap_ID)
				this.CreateCommandParameter(cmd,"@LoaiDoiTuongTroCap_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LoaiDoiTuongTroCap_ID",o.LoaiDoiTuongTroCap_ID);

			if(o.IsNullKhoanTien_ID)
				this.CreateCommandParameter(cmd,"@KhoanTien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhoanTien_ID",o.KhoanTien_ID);

			if(o.IsNullMucTroCap)
				this.CreateCommandParameter(cmd,"@MucTroCap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MucTroCap",o.MucTroCap);

			if(o.IsNullKieuTroCap)
				this.CreateCommandParameter(cmd,"@KieuTroCap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KieuTroCap",o.KieuTroCap);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,KieuHuongTroCap_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int KieuHuongTroCap_ID){
			string strSQL="UPDATE  [KieuHuongTroCap] SET [KieuHuongTroCap].["+ColumnName+"]=@ColumnName WHERE [KieuHuongTroCap].[KieuHuongTroCap_ID]=@KieuHuongTroCap_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",KieuHuongTroCap_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Update</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(KieuHuongTroCapEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of KieuHuongTroCapEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<KieuHuongTroCapEntity>list){
			foreach(KieuHuongTroCapEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateLoaiDoiTuongTroCap_ID</para>
		/// <para>Input: NewLoaiDoiTuongTroCap_ID,KieuHuongTroCap_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateLoaiDoiTuongTroCap_ID(int NewLoaiDoiTuongTroCap_ID,int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("LoaiDoiTuongTroCap_ID",NewLoaiDoiTuongTroCap_ID,KieuHuongTroCap_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateKhoanTien_ID</para>
		/// <para>Input: NewKhoanTien_ID,KieuHuongTroCap_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateKhoanTien_ID(int NewKhoanTien_ID,int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("KhoanTien_ID",NewKhoanTien_ID,KieuHuongTroCap_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateMucTroCap</para>
		/// <para>Input: NewMucTroCap,KieuHuongTroCap_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMucTroCap(Decimal NewMucTroCap,int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MucTroCap",NewMucTroCap,KieuHuongTroCap_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateKieuTroCap</para>
		/// <para>Input: NewKieuTroCap,KieuHuongTroCap_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateKieuTroCap(Byte NewKieuTroCap,int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("KieuTroCap",NewKieuTroCap,KieuHuongTroCap_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [KieuHuongTroCap]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(KieuHuongTroCapEntity o){
			string strSQL="DELETE   FROM [KieuHuongTroCap]   WHERE [KieuHuongTroCap].[KieuHuongTroCap_ID]=@KieuHuongTroCap_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullKieuHuongTroCap_ID)
				this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",o.KieuHuongTroCap_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: KieuHuongTroCap_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int KieuHuongTroCap_ID){
			string strSQL="DELETE   FROM [KieuHuongTroCap]   WHERE [KieuHuongTroCap].[KieuHuongTroCap_ID]=@KieuHuongTroCap_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@KieuHuongTroCap_ID",KieuHuongTroCap_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [KieuHuongTroCap]   WHERE [KieuHuongTroCap].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Delete</para>
		/// <para>Input: KieuHuongTroCapEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(KieuHuongTroCapEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: KieuHuongTroCap_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int KieuHuongTroCap_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(KieuHuongTroCap_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to KhoanTienLoaiDoiTuongTroCap functions
		#endregion

		#region Select join to KhoanTien functions
		#endregion

		#region Select join to LoaiDoiTuongTroCap functions
		#endregion

		#region Select,delete by KieuHuongTroCap_ID functions
		#endregion

		#region Select,delete by LoaiDoiTuongTroCap_ID functions
		#endregion

		#region Select,delete by KhoanTien_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: KieuHuongTroCapEntity</para>
		///</summary>
		protected override KieuHuongTroCapEntity MapObject(IDataReader r){
			KieuHuongTroCapEntity entity = new KieuHuongTroCapEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("KieuHuongTroCap_ID");
						if (!r.IsDBNull(ordinal)) entity.KieuHuongTroCap_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("LoaiDoiTuongTroCap_ID");
						if (!r.IsDBNull(ordinal)) entity.LoaiDoiTuongTroCap_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("KhoanTien_ID");
						if (!r.IsDBNull(ordinal)) entity.KhoanTien_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MucTroCap");
						if (!r.IsDBNull(ordinal)) entity.MucTroCap = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("KieuTroCap");
						if (!r.IsDBNull(ordinal)) entity.KieuTroCap = ((Byte)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END KieuHuongTroCapDAOBase*****************************************/
	/*****************************************************************************************************/
}

